home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat1 / bfs.z / bfs
Encoding:
Text File  |  1998-10-20  |  13.1 KB  |  265 lines

  1.  
  2.  
  3.  
  4. bbbbffffssss((((1111))))                                                                  bbbbffffssss((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _bbbb_ffff_ssss - big file scanner
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _bbbb_ffff_ssss [ _---- ] _f_i_l_e
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The _bbbb_ffff_ssss command is similar to _eeee_dddd except that it is read-only and
  16.      processes much larger files.  Files can be up to 1024K bytes and 32K
  17.      lines, with up to 512 bytes, including new-line, per line (255 for 16-bit
  18.      machines).  _bbbb_ffff_ssss is usually more efficient than _eeee_dddd for scanning a file,
  19.      since the file is not copied to a buffer.  It is most useful for
  20.      identifying sections of a large file where the _cccc_ssss_pppp_llll_iiii_tttt command can be used
  21.      to divide it into more manageable pieces for editing.
  22.  
  23.      _bbbb_ffff_ssss processes supplementary code set characters in _f_i_l_e, and recognizes
  24.      supplementary code set characters in the _l_a_b_e_ls given to the _::::, _xxxx_bbbb, _xxxx_bbbb_nnnn,
  25.      and _xxxx_bbbb_zzzz commands (see below) according to the locale specified in the
  26.      _LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE environment variable (see _LLLL_AAAA_NNNN_GGGG on _eeee_nnnn_vvvv_iiii_rrrr_oooo_nnnn(5)).  In regular
  27.      expressions, pattern searches are performed on characters, not bytes, as
  28.      described on _eeee_dddd(1).
  29.  
  30.      Normally, the size in bytes of the file being scanned is printed, as is
  31.      the size of any file written with the _wwww command.  The optional _----
  32.      suppresses printing of sizes.  Input is prompted with _**** if _PPPP and a
  33.      carriage return are typed, as in _eeee_dddd.  Prompting can be turned off again
  34.      by inputting another _PPPP and carriage return.  Messages are given in
  35.      response to errors if prompting is turned on.
  36.  
  37.      All address expressions described under _eeee_dddd are supported.  In addition,
  38.      regular expressions may be surrounded with two symbols besides _//// and _????:
  39.      _>>>> indicates downward search without wrap-around, and _<<<< indicates upward
  40.      search without wrap-around.  There is a slight difference in mark names:
  41.      only the ASCII characters _aaaa through _zzzz may be used, and all 26 marks are
  42.      remembered.
  43.  
  44.      The _eeee, _gggg, _vvvv, _kkkk, _pppp, _qqqq, _wwww, _====, _!!!!  and null commands operate as described
  45.      under _eeee_dddd.  Commands such as _----_----_----, _++++_++++_++++_----, _++++_++++_++++_====, _----_1111_2222, and _++++_4444_pppp are accepted.
  46.      Note that _1111_,,,,_1111_0000_pppp and _1111_,,,,_1111_0000 both print the first ten lines.  The _ffff command
  47.      only prints the name of the file being scanned; there is no remembered
  48.      filename.  The _wwww command is independent of output diversion, truncation,
  49.      or crunching (see the _xxxx_oooo, _xxxx_tttt, and _xxxx_cccc commands, below).  The following
  50.      additional commands are available:
  51.  
  52.         _xxxx_ffff _f_i_l_e     Further commands are taken from the named _f_i_l_e.  When an
  53.                     end-of-file is reached, an interrupt signal is received or
  54.                     an error occurs, reading resumes with the file containing
  55.                     the _xxxx_ffff.  The _xxxx_ffff commands may be nested to a depth of 10.
  56.  
  57.         _xxxx_nnnn          List the marks currently in use (marks are set by the _kkkk
  58.                     command).
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. bbbbffffssss((((1111))))                                                                  bbbbffffssss((((1111))))
  71.  
  72.  
  73.  
  74.         _xxxx_oooo [_f_i_l_e]   Further output from the _pppp and null commands is diverted to
  75.                     the named _f_i_l_e, which, if necessary, is created with mode
  76.                     666 (readable and writable by everyone), unless your _uuuu_mmmm_aaaa_ssss_kkkk
  77.                     setting dictates otherwise; see _uuuu_mmmm_aaaa_ssss_kkkk(1).  If _f_i_l_e is
  78.                     missing, output is diverted to the standard output.  Note
  79.                     that each diversion causes truncation or creation of the
  80.                     file.
  81.  
  82.         _:::: _l_a_b_e_l     This positions a _l_a_b_e_l in a command file.  The _l_a_b_e_l is
  83.                     terminated by new-line, and blanks between the _::::  and the
  84.                     _l_a_b_e_l are ignored.  This command may also be used to
  85.                     insert comments into a command file, since labels need not
  86.                     be referenced.  _l_a_b_e_l may contain supplementary code set
  87.                     characters.
  88.  
  89.         ( _....         , _....  )_xxxx_bbbb/_r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n/_l_a_b_e_l A jump (either upward or
  90.                     downward) is made to _l_a_b_e_l if the command succeeds.  It
  91.                     fails under any of the following conditions:
  92.  
  93.                         1.  Either address is not between _1111 and _$$$$.
  94.                         2.  The second address is less than the first.
  95.                         3.  The regular expression does not match at least one
  96.                         line in the specified range, including the first and
  97.                         last lines.
  98.  
  99.                     On success, _.... is set to the line matched and a jump is
  100.                     made to _l_a_b_e_l.  This command is the only one that does not
  101.                     issue an error message on bad addresses, so it may be used
  102.                     to test whether addresses are bad before other commands
  103.                     are executed.  Note that the command
  104.  
  105.                         _xxxx_bbbb_////_^^^^_//// _llll_aaaa_bbbb_eeee_llll
  106.  
  107.                     is an unconditional jump.
  108.  
  109.                     The _xxxx_bbbb command is allowed only if it is read from
  110.                     someplace other than a terminal.  If it is read from a
  111.                     pipe only a downward jump is possible.  _l_a_b_e_l may contain
  112.                     supplementary code set characters.
  113.  
  114.         _xxxx_tttt _n_u_m_b_e_r   Output from the _pppp and null commands is truncated to at
  115.                     most _n_u_m_b_e_r displayed columns.  The initial number is 255.
  116.  
  117.         _xxxx_vvvv[_d_i_g_i_t][_s_p_a_c_e_s][_v_a_l_u_e]
  118.                     The variable name is the specified _d_i_g_i_t following the _xxxx_vvvv.
  119.                     The commands _xxxx_vvvv_5555_1111_0000_0000 or _xxxx_vvvv_5555 _1111_0000_0000 both assign the value _1111_0000_0000
  120.                     to the variable _5555.  The command _xxxx_vvvv_6666_1111_,,,,_1111_0000_0000_pppp assigns the
  121.                     value _1111_,,,,_1111_0000_0000_pppp to the variable _6666.  To reference a variable,
  122.                     put a _%%%% in front of the variable name.  For example, using
  123.                     the above assignments for variables _5555 and _6666:
  124.  
  125.                         _1111_,,,,_%%%%_5555_pppp
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. bbbbffffssss((((1111))))                                                                  bbbbffffssss((((1111))))
  137.  
  138.  
  139.  
  140.                         _1111_,,,,_%%%%_5555
  141.                         _%%%%_6666
  142.  
  143.                     all print the first 100 lines.
  144.  
  145.                         _gggg_////_%%%%_5555_////_pppp
  146.  
  147.                     globally searches for the characters _1111_0000_0000 and prints each
  148.                     line containing a match.  To escape the special meaning of
  149.                     _%%%%, a _\\\\ must precede it.
  150.  
  151.                         _gggg_////_""""_...._****_[[[[_cccc_dddd_ssss_]]]]_////_pppp
  152.  
  153.                     could be used to match and list lines containing a _pppp_rrrr_iiii_nnnn_tttt_ffff
  154.                     of characters, decimal integers, or strings.
  155.  
  156.                     Another feature of the _xxxx_vvvv command is that the first line
  157.                     of output from a UNIX system command can be stored into a
  158.                     variable.  The only requirement is that the first
  159.                     character of _v_a_l_u_e be an _!!!!.  For example:
  160.  
  161.                         _...._wwww _jjjj_uuuu_nnnn_kkkk
  162.                         _xxxx_vvvv_5555_!!!!_cccc_aaaa_tttt _jjjj_uuuu_nnnn_kkkk
  163.                         _!!!!_rrrr_mmmm _jjjj_uuuu_nnnn_kkkk
  164.                         _!!!!_eeee_cccc_hhhh_oooo _""""_%%%%_5555_""""
  165.                         _xxxx_vvvv_6666_!!!!_eeee_xxxx_pppp_rrrr _%%%%_6666 _++++ _1111
  166.  
  167.                     puts the current line into variable _5555, prints it, and
  168.                     increments the variable _6666 by one.  To escape the special
  169.                     meaning of _!!!!  as the first character of _v_a_l_u_e, precede it
  170.                     with a _\\\\.
  171.  
  172.                         _xxxx_vvvv_7777_\\\\_!!!!_dddd_aaaa_tttt_eeee
  173.  
  174.                     stores the value _!!!!_dddd_aaaa_tttt_eeee into variable _7777.
  175.  
  176.         _xxxx_bbbb_zzzz _l_a_b_e_l
  177.  
  178.         _xxxx_bbbb_nnnn _l_a_b_e_l   These two commands test the last saved _r_e_t_u_r_n _c_o_d_e from
  179.                     the execution of a UNIX system command (_!!!!_c_o_m_m_a_n_d) or
  180.                     nonzero value, respectively, to the specified label.
  181.                     _l_a_b_e_l may contain supplementary code set characters.  The
  182.                     two examples below both search for the next five lines
  183.                     containing the string _ssss_iiii_zzzz_eeee.
  184.  
  185.                         _xxxx_vvvv_5555_5555
  186.                         _:::: _llll
  187.                         _////_ssss_iiii_zzzz_eeee_////
  188.                         _xxxx_vvvv_5555_!!!!_eeee_xxxx_pppp_rrrr _%%%%_5555 _---- _1111
  189.                         _!!!!_iiii_ffff _0000_%%%%_5555 _!!!!_==== _0000 _eeee_xxxx_iiii_tttt _2222
  190.                         _xxxx_bbbb_nnnn _llll
  191.                         _xxxx_vvvv_4444_5555
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. bbbbffffssss((((1111))))                                                                  bbbbffffssss((((1111))))
  203.  
  204.  
  205.  
  206.                         _:::: _llll
  207.                         _////_ssss_iiii_zzzz_eeee_////
  208.                         _xxxx_vvvv_4444_!!!!_eeee_xxxx_pppp_rrrr _%%%%_4444 _---- _1111
  209.                         _!!!!_iiii_ffff _0000_%%%%_4444 _==== _0000 _eeee_xxxx_iiii_tttt _2222
  210.                         _xxxx_bbbb_zzzz _llll
  211.  
  212.         _xxxx_cccc [_s_w_i_t_c_h] If _s_w_i_t_c_h is _1111, output from the _pppp and null commands is
  213.                     crunched; if _s_w_i_t_c_h is _0000 it is not.  Without an argument,
  214.                     _xxxx_cccc reverses _s_w_i_t_c_h.  Initially _s_w_i_t_c_h is set for no
  215.                     crunching.  Crunched output has strings of tabs and blanks
  216.                     reduced to one blank and blank lines suppressed.
  217.  
  218. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  219.      csplit(1), ed(1), umask(1), regexp(5).
  220.  
  221. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  222.      _????  for errors in commands, if prompting is turned off.  Self-explanatory
  223.      error messages when prompting is on.
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.